import { readonly, ref } from 'vue';
import {
  FEATURE_UNLOCK_ID,
  type FeatureId,
} from '../game/data/feature-unlock/type';

const menuList = readonly([
  {
    id: FEATURE_UNLOCK_ID.EXPERIENCE,
    label: '历练',
  },
  {
    id: FEATURE_UNLOCK_ID.FANG_SHI,
    label: '坊市',
  },
]);

const activeMenu = ref<FeatureId>(FEATURE_UNLOCK_ID.WORLD);

export function useWorld() {
  function back() {
    activeMenu.value = FEATURE_UNLOCK_ID.WORLD;
  }

  function changeMenu(id: FeatureId) {
    activeMenu.value = id;
  }

  return { activeMenu, menuList, back, changeMenu };
}
